package com.wedimob.plugins.scrapper;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import com.wedimob.bo.SerializableBO;
import com.wedimob.content.Content;

public class Author extends SerializableBO<Author> {
	private String username;

	private String name;

	private String title;

	private String organization;

	private String location;

	private String resume;

	private Calendar registrationDate;

	private Content picture;

	private List<Content> publications;

	public Author() {
		super();
	}

	public Author(String name, String username, String title,
			String organization, String location, String resume,
			Calendar registrationDate, Content picture) {
		super();
		this.name = name;
		this.username = username;
		this.title = title;
		this.organization = organization;
		this.location = location;
		this.resume = resume;
		this.registrationDate = registrationDate;
		this.picture = picture;
		publications = new ArrayList<Content>();
	}

	public List<Content> getPublications() {
		return publications;
	}

	public String getOrganization() {
		return organization;
	}

	public void setOrganization(String organization) {
		this.organization = organization;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getResume() {
		return resume;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	public Calendar getRegistrationDate() {
		return registrationDate;
	}

	public void setRegistrationDate(Calendar registrationDate) {
		this.registrationDate = registrationDate;
	}

	public Content getPicture() {
		return picture;
	}

	public void setPicture(Content picture) {
		this.picture = picture;
	}

	public URL getURL() {
		try {
			return new URL(SlideShareScrapper.URL_BASE + "/" + username);
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null;
		}
	}

	public URL getSlidesURL() {
		try {
			return new URL(SlideShareScrapper.URL_BASE + "/" + username
					+ "/slideshelf");
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null;
		}
	}
}
